package com.cloud.pikachu.dingtalk.controller;

import com.cloud.pikachu.dingtalk.service.credential.ViewCredentialModel;
import com.cloud.pikachu.dingtalk.service.credential.ViewCredentialService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/view/credential")
public class ViewCredentialController {

    @Autowired
    private ViewCredentialService viewCredentialService;

    /**
     * 获取网页签名
     * @param viewUrl 网页地址 网页地址中的 & 符号，转化成 @@@@ 传输过来
     * @param agentId 应用id
     * @return
     */
    @PostMapping
    public ViewCredentialModel getViewCredential(@RequestParam("viewUrl") String viewUrl ,@RequestParam("agentId") String agentId){
        ViewCredentialModel viewCredential = viewCredentialService.getViewCredential(viewUrl, agentId);
        return viewCredential;
    }

}
